import type { ObjectType } from '../types';
import { BaseInsertDto, BaseUpdateDto } from './.dto';

/** 权限列表DTO */
export class PermissionListDto implements ObjectType {
  id: string = '';
  name: string = '';
  code: string = '';
}

/** 权限单个DTO */
export class PermissionSingleDto implements ObjectType {
  id: string = '';
  name: string = '';
  code: string = '';
  remark: string = '';
}

/** 权限创建DTO */
export class PermissionCreateDto {
  name: string = '';
  code: string = '';
  remark: string = '';
}

/** 权限更新DTO */
export class PermissionUpdateDto extends BaseUpdateDto {
  name: string = '';
  code: string = '';
  remark: string = '';
}

/**
 * @swagger
 * components:
 *   schemas:
 *     PermissionListDto:
 *       type: object
 *       properties:
 *         id:
 *           type: integer
 *           description: 权限的唯一标识符
 *           example: 1
 *         name:
 *           type: string
 *           description: 权限名称，描述权限的功能
 *           example: '用户管理'
 *         code:
 *           type: string
 *           description: 权限代码，系统中用于标识权限的唯一字符串
 *           example: 'USER_MANAGE'
 *     PermissionSingleDto:
 *       allOf:
 *         - $ref: '#/components/schemas/PermissionListDto'
 *     PermissionCreateDto:
 *       type: object
 *       properties:
 *         name:
 *           type: string
 *           description: 权限名称，描述权限的功能
 *           example: '用户管理'
 *         code:
 *           type: string
 *           description: 权限代码，系统中用于标识权限的唯一字符串
 *           example: 'USER_MANAGE'
 *     PermissionUpdateDto:
 *       type: object
 *       properties:
 *         name:
 *           type: string
 *           description: 权限名称，描述权限的功能
 *           example: '用户管理'
 *         code:
 *           type: string
 *           description: 权限代码，系统中用于标识权限的唯一字符串
 *           example: 'USER_MANAGE'
 */
